package com.sh.rabbitmq;

import com.rabbitmq.client.Channel;
import com.sh.rabbitmq.utils.ChannelFactory;

import java.util.Scanner;

public class Producer {

    public static final String EXCHANGE_NAME = "topic_logs";

    public static void main(String[] args) throws Exception {
        Channel channel = ChannelFactory.getChannel();


        Scanner sc = new Scanner(System.in);
        while (sc.hasNext()) {
            String next = sc.next();
            channel.basicPublish(EXCHANGE_NAME, "lazy.orange.rabbit", null, next.getBytes());
            System.out.println("发送成功");
        }

    }
}
